package com.kele.service.impl;

import com.kele.dao.ThumbsUpDao;
import com.kele.domain.ThumbsUp;
import com.kele.service.ThumbsUpService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("thumbsUpService")
public class ThumbsUpServiceImpl implements ThumbsUpService {

    @Resource
    private ThumbsUpDao thumbsUpDao;

    /**
     * 插入一条点赞记录
     * @param thumbsup
     * @return
     */
    @Override
    public Integer insertthumbsUp(ThumbsUp thumbsup) {
        return thumbsUpDao.insertthumbsUp(thumbsup);
    }

    /**
     * 根据id删除一条点赞记录
     * @param id
     * @return
     */
    @Override
    public Integer deleteThumbsUp(int id) {
        return thumbsUpDao.deleteThumbsUp(id);
    }

    /**
     * 根据博客id和用户id查询点赞记录
     * @param blogid
     * @param userid
     * @return
     */
    @Override
    public ThumbsUp findThumbsUp(int blogid, int userid) {
        return thumbsUpDao.findThumbsUp(blogid,userid);
    }

    /**
     * 根据点赞记录查询点赞记录
     * @param thumbsup
     * @return
     */
    @Override
    public List<ThumbsUp> findThumbsUpList(ThumbsUp thumbsup) {
        return thumbsUpDao.findThumbsUpList(thumbsup);
    }
}
